package IO;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.ObjectOutputStream;

public class OosDemo  {
    public static void main(String[] args) throws IOException {
        String name="李富利";
        int age=18;
        String gender="女";
        String[]otherInfo={"高富帅","爱睡觉","爱打游戏"};
        Person person=new Person(name,age,gender,otherInfo);

        FileOutputStream fos=new FileOutputStream("person.obj");
        ObjectOutputStream oos=new ObjectOutputStream(fos);
        oos.writeObject(person);
        System.out.println("写入完毕");
        oos.close();
    }
}
